import { IBusinessHandler } from "../Util/IBusinessHandler";
import { IIOHandler } from "../Util/IIOHandler";
import ByteArray = require("bytearray-node");
type int = number;
//class IProtocol

export interface IProtocol {
  /**
   * 处理响应数据
   * @param bytes
   * @param businessHandler1
   * @param ioHandler
   * @param businessHandler2
   * @return
   */
  handleData(
    bytes: ByteArray,
    businessHandler1: IBusinessHandler,
    ioHandler: IIOHandler,
    businessHandler2?: IBusinessHandler
  ): int;

  /**
   * 发送编码数据
   * @param bytes
   * @param ioHandler
   * @return
   */
  sendDataEncrypt(bytes: ByteArray, ioHandler: IIOHandler): Boolean;

  clear(): void;
}
